package com.welink.cmp.adapter.api.metadata;

import com.welink.cmp.dto.metadata.vpc.CreateVpcAddCmd;
import com.welink.cmp.meatdata.service.VpcAppService;
import com.welink.common.dto.SingleResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * VPC生命周期管理接口
 *
 * @create liyanwei
 */
@RestController
@RequestMapping("/api/vpc")
public class VpcLifeCycleServiceApi {

    @Autowired
    private VpcAppService vpcAppService;

    /**
     * 创建VPC
     *
     * @param addCmd 创建VPC指令
     * @return VPC ID
     */
    @PostMapping("/add")
    public SingleResponse<Long> addVpc(@RequestBody CreateVpcAddCmd addCmd) {
        final Long l = vpcAppService.addVpc(addCmd);
        return SingleResponse.of(l);
    }


}